package SwingView.Quiz;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import JDBC.InstructorQuizActivities;
import JDBC.StudentQuizActivities;
import SwingController.CmsPresenter;
import SwingModel.CmsInstructor;
import SwingModel.CmsQuiz;
import SwingModel.CmsUser;
import SwingView.CmsMainView;
import SwingView.CmsPageSelector.CmsPage;
import SwingView.Lecture.CmsCPInstructorLecture;
import SwingView.Lecture.CmsCPStudentLecture;

public class ALQuiz implements ActionListener{

	//---------------------------------------------------------
	//PERFORMING ACTION:
	//---------------------------------------------------------		
	@Override
	public void actionPerformed(ActionEvent e){
		CmsUser user = CmsPresenter.user;
		CmsMainView mainView = CmsPresenter.mainView;
		
		//.....................................................
		//INSTRUCTOR CASE:
		if (user instanceof CmsInstructor){
			
			//Highlight the Quiz Button
			System.out.println("ALQUIZ: display quiz main instructor page");
			mainView.displayQuizInstructorPage(InstructorQuizActivities.getListOfQuiz(user.getSelectedCourse().getCourseID()));
		}
		
		//.....................................................
		//STUDENT CASE:
		else{//Student case
			//Highlight the Quiz Button
			//TODO
			mainView.displayQuizStudentPage(StudentQuizActivities.getListOfQuiz(user.getSelectedCourse().getCourseID()));
		}
		
	}
}
